#include <stdlib.h>
#include <stdio.h>
#include <map>
#include <algorithm>
#include <array>
#include <fstream>
#include <sstream>
#include <iostream>
#include <string>
#include "data.h"

using namespace std;

bool connection::operator < (const connection & conn) const {
	
	bool result = false;

	if((source.id < conn.source.id) ||
		(source.id == conn.source.id && destination.id < conn.destination.id))
		result = true;

	return(result); 
}

bool connection::operator == (const connection & conn1) const{

	bool result = false;
	connection _reverse_conn;
	_reverse_conn.destination = conn1.source;
	_reverse_conn.source      = conn1.destination;

	if((this->source.id == conn1.source.id && this->destination.id == conn1.destination.id) ||
	   (this->source.id == _reverse_conn.source.id && this->destination.id == _reverse_conn.destination.id))
		result = true;
	return result;
}